import { TOOLBAR_BUTTON_TYPES } from '@ohif/core';

const definitions = [
  {
    id: 'share',
    label: 'Share',
    icon: 'share',
    className: 'hideOnPhone',
    type: TOOLBAR_BUTTON_TYPES.COMMAND,
    commandName: 'showShare',
  },
  {
    id: 'settings',
    label: 'Settings',
    icon: 'settings',
    buttons: [
      {
        id: 'asyncScroll',
        label: 'ASync Scroll',
        icon: 'async-scroll',
        labelWhenActive: 'ASync Scroll',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'setImageSync',
        commandOptions: { sync: 'none'},
        options: {
          keys: ['preferences.commons.imageSync'],
          values: ['none'],
        }
      },
      {
        id: 'positionSync',
        label: 'Position Sync',
        icon: 'position-sync',
        labelWhenActive: 'Position Sync',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'setImageSync',
        commandOptions: { sync: 'position'},
        options: {
          keys: ['preferences.commons.imageSync'],
          values: ['position'],
        }
      },
      {
        id: 'indexSync',
        label: 'Index Sync',
        icon: 'index-sync',
        labelWhenActive: 'Index Sync',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'setImageSync',
        commandOptions: { sync: 'index'},
        options: {
          keys: ['preferences.commons.imageSync'],
          values: ['index'],
        }
      },
      {
        id: 'divider01',
        type: TOOLBAR_BUTTON_TYPES.DIVIDER
      },
      {
        id: 'showPatientInfo',
        label: 'Show Patient Info',
        icon: 'patient-info',
        labelWhenActive: 'Hide Patient Info',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'showPatientInfo',
        options: {
          keys: ['preferences.commons.showPatientInfo'],
          values: [true],
        }
      },
      {
        id: 'showCornerInfo',
        label: 'Show Corner Info',
        icon: 'corner-info',
        labelWhenActive: 'Hide Corner Info',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'showCornerInfo',
        options: {
          keys: ['preferences.commons.showCornerInfo'],
          values: [true],
        }
      },
      // {
      //   id: 'showAnno',
      //   label: 'Show Anno',
      //   icon: '',
      //   type: TOOLBAR_BUTTON_TYPES.STATE,
      //   commandName: 'showAnno',
      // },
      {
        id: 'showRefLine',
        label: 'Show RefLine',
        icon: 'ref-line',
        labelWhenActive: 'Hide RefLine',
        iconWhenActive: '',
        type: TOOLBAR_BUTTON_TYPES.STATE,
        commandName: 'showRefLine',
        options: {
          keys: ['preferences.commons.showRefLine'],
          values: [true],
        }
      },
      {
        id: 'divider02',
        className: 'hideOnDesktop',
        type: TOOLBAR_BUTTON_TYPES.DIVIDER
      },
      {
        id: 'help',
        label: 'Help',
        icon: 'help',
        className: 'hideOnDesktop',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showHelp',
      },
      {
        id: 'share',
        label: 'Share',
        icon: 'share',
        className: 'hideOnDesktop',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showShare',
      },
      {
        id: 'divider03',
        className: 'hideOnDesktop',
        type: TOOLBAR_BUTTON_TYPES.DIVIDER
      },
      {
        id: 'about',
        label: 'About',
        icon: 'about',
        className: 'hideOnDesktop',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showAbout',
      },
    ]
  },
  {
    id: 'help',
    label: 'Help',
    icon: 'help',
    className: 'hideOnPhone',
    type: TOOLBAR_BUTTON_TYPES.COMMAND,
    commandName: 'showHelp',
    buttons: [
      {
        id: 'help',
        label: 'Help',
        icon: 'help',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showHelp',
      },
      {
        id: 'share',
        label: 'Share',
        icon: 'share',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showShare',
      },
      {
        id: 'divider01',
        type: TOOLBAR_BUTTON_TYPES.DIVIDER
      },
      {
        id: 'about',
        label: 'About',
        icon: 'about',
        type: TOOLBAR_BUTTON_TYPES.COMMAND,
        commandName: 'showAbout',
      },
    ]
  }
];

export default {
  definitions,
  defaultContext: 'VIEWER',
};
